package tech.aistar.corejava.day04;

/**
 * Created by 李雨昂 on 2019/7/18.
 */
public class MathDemo {
    public static void main(String[] args) {

        //
        int x = (int) (Math.random()*100+1);
        System.out.println("x = " + x);

        //
        //向下取整
        System.out.println(Math.floor(3.5));// 3.0
        System.out.println(Math.floor(3.0));// 3.0
        System.out.println(Math.floor(-3.5));// -4.0

        //long static round(double n);//返回最接近参数的long
        System.out.println(Math.round(3.4));// 3
        System.out.println(Math.round(3.49));// 3
        System.out.println(Math.round(3.5));// 4
        System.out.println(Math.round(3.6));// 4
    }
}
